from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

# 打开浏览器
driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
time.sleep(2)

kw = driver.find_element(By.ID,"kw")
kw.send_keys('天气预报')
kw.send_keys(Keys.CONTROL,"a")
kw.send_keys(Keys.CONTROL,"c")

driver.get("https://www.so.com")
ipt = driver.find_element(By.ID,"input")
ipt.send_keys(Keys.CONTROL,"v")
driver.find_element(By.ID,"search-button").click()

time.sleep(2)
driver.quit()

